package com.yundasys.lab08jvm.heapoom;

/**
 * @PACKAGE_NAME: com.yundasys.lab08jvm.heapoom
 * @NAME: StackOOMTest1
 * @USER: jiangta
 * @DATE: 2021/2/8
 * @TIME: 8:54 下午
 * @PROJECT_NAME: springboot-labs
 *
 * 默认配置：17868
 * 
 */
public class StackOOMTest1 {
    private int stackLength =1;

    private void stackLeak() {
        stackLength++;
        this.stackLeak();
    }

    public static void main(String[] args) {

        StackOOMTest1 oomTest1 = new StackOOMTest1();
        try {
            oomTest1.stackLeak();
        }catch (Exception e) {
            System.out.println("stack length:" + oomTest1.stackLength);
            throw e;
        }
    }
}
